<template>
  <div class="page_root" :key="queryUpdateFlag" data-page-name="工单系统-审批详情页" data-page-identification="t_0qmx2r0fpk">
    <a-spin :spinning="pageLoading.loading" :tip="pageLoading.tip">
      <!-- begin vid_uxpvwba9ur 容器_mdhrfxo8ha -->
      <al-box class="vid_uxpvwba9ur">
        <!-- begin vid_ut0hyv71uf 容器_olru2sccad -->
        <al-box class="vid_ut0hyv71uf">
          <!-- begin vid_qda7xszz78 容器_pa5tx52lro -->
          <al-box class="vid_qda7xszz78">
            <!-- begin vid_sfilmvv65x 基本信息 -->
            <span class="vid_sfilmvv65x"> 基本信息 </span>
            <!-- end vid_sfilmvv65x 基本信息 -->
          </al-box>
          <!-- end vid_qda7xszz78 容器_pa5tx52lro -->
          <!-- begin vid_bhevxdfy3x 容器_3fhp5qvhrd -->
          <al-box class="vid_bhevxdfy3x">
            <!-- begin vid_hte17hl8ou 审批类型： -->
            <span class="vid_hte17hl8ou"> 审批类型： </span>
            <!-- end vid_hte17hl8ou 审批类型： -->
            <!-- begin vid_8ce19j1ydg 工单-任务-无需解决 -->
            <span class="vid_8ce19j1ydg">
              {{ renderStringInTemplate(vid_8ce19j1ydg_props.rt_text) }}
            </span>
            <!-- end vid_8ce19j1ydg 工单-任务-无需解决 -->
          </al-box>
          <!-- end vid_bhevxdfy3x 容器_3fhp5qvhrd -->
          <!-- begin vid_i2ofvy9ut6 布局容器_fwpywrmbsu -->
          <a-row class="vid_i2ofvy9ut6" :gutter="16" :slots="'12:12'">
            <a-col :span="12">
              <!-- begin vid_xsoiwpee0x 工单标题： -->
              <span class="vid_xsoiwpee0x"> 工单标题： </span>
              <!-- end vid_xsoiwpee0x 工单标题： -->
              <!-- begin vid_zqjezxqu9b 简单文本_n8z2syxfny -->
              <span class="vid_zqjezxqu9b">
                {{ renderStringInTemplate(vid_zqjezxqu9b_props.rt_text) }}
              </span>
              <!-- end vid_zqjezxqu9b 简单文本_n8z2syxfny -->
            </a-col>
            <a-col :span="12">
              <!-- begin vid_u2aqso72mj 所属父工单标题： -->
              <span class="vid_u2aqso72mj"> 所属父工单标题： </span>
              <!-- end vid_u2aqso72mj 所属父工单标题： -->
              <!-- begin vid_cop9kfadhp 简单文本_uqrw31a556 -->
              <span class="vid_cop9kfadhp">
                {{ renderStringInTemplate(vid_cop9kfadhp_props.rt_text) }}
              </span>
              <!-- end vid_cop9kfadhp 简单文本_uqrw31a556 -->
            </a-col>
          </a-row>
          <!-- end vid_i2ofvy9ut6 布局容器_fwpywrmbsu -->
          <!-- begin vid_nagpuukn82 布局容器_5jfhe7h2a2 -->
          <a-row class="vid_nagpuukn82" :gutter="16" :slots="'6:6:6:6'">
            <a-col :span="6">
              <!-- begin vid_hj3xdjhqd6 工单类型： -->
              <span class="vid_hj3xdjhqd6"> 工单类型： </span>
              <!-- end vid_hj3xdjhqd6 工单类型： -->
              <!-- begin vid_qf2v3d3c2j 简单文本_uvkw7oc23k -->
              <span class="vid_qf2v3d3c2j">
                {{ renderStringInTemplate(vid_qf2v3d3c2j_props.rt_text) }}
              </span>
              <!-- end vid_qf2v3d3c2j 简单文本_uvkw7oc23k -->
            </a-col>
            <a-col :span="6">
              <!-- begin vid_jah01n1yhb 优先级： -->
              <span class="vid_jah01n1yhb"> 优先级： </span>
              <!-- end vid_jah01n1yhb 优先级： -->
              <!-- begin vid_a8fpctzwsi 简单文本_9wrymjzfkt -->
              <span class="vid_a8fpctzwsi">
                {{ renderStringInTemplate(vid_a8fpctzwsi_props.rt_text) }}
              </span>
              <!-- end vid_a8fpctzwsi 简单文本_9wrymjzfkt -->
            </a-col>
            <a-col :span="6">
              <!-- begin vid_6fzon2o21y 问题来源： -->
              <span class="vid_6fzon2o21y"> 问题来源： </span>
              <!-- end vid_6fzon2o21y 问题来源： -->
              <!-- begin vid_rmf47obj3i 简单文本_8n3wwzc2t0 -->
              <span class="vid_rmf47obj3i">
                {{ renderStringInTemplate(vid_rmf47obj3i_props.rt_text) }}
              </span>
              <!-- end vid_rmf47obj3i 简单文本_8n3wwzc2t0 -->
            </a-col>
            <a-col :span="6">
              <!-- begin vid_6hbeo2wstw 所属区域： -->
              <span class="vid_6hbeo2wstw"> 所属区域： </span>
              <!-- end vid_6hbeo2wstw 所属区域： -->
              <!-- begin vid_2uqlwipwoj 简单文本_mox6lq7e9k -->
              <span class="vid_2uqlwipwoj">
                {{ renderStringInTemplate(vid_2uqlwipwoj_props.rt_text) }}
              </span>
              <!-- end vid_2uqlwipwoj 简单文本_mox6lq7e9k -->
            </a-col>
          </a-row>
          <!-- end vid_nagpuukn82 布局容器_5jfhe7h2a2 -->
          <!-- begin vid_8xrcgsldj2 布局容器_z1jxtyerbz -->
          <a-row class="vid_8xrcgsldj2" :gutter="16" :slots="'6:6:6:6'">
            <a-col :span="6">
              <!-- begin vid_q4lwx5giy5 所属项目： -->
              <span class="vid_q4lwx5giy5"> 所属项目： </span>
              <!-- end vid_q4lwx5giy5 所属项目： -->
              <!-- begin vid_4sxywu7un5 简单文本_1lnwtw6uij -->
              <span class="vid_4sxywu7un5">
                {{ renderStringInTemplate(vid_4sxywu7un5_props.rt_text) }}
              </span>
              <!-- end vid_4sxywu7un5 简单文本_1lnwtw6uij -->
            </a-col>
            <a-col :span="6">
              <!-- begin vid_14bdavhk13 所属产品： -->
              <span class="vid_14bdavhk13"> 所属产品： </span>
              <!-- end vid_14bdavhk13 所属产品： -->
              <!-- begin vid_0vii052zlz 简单文本_fjzyutphp4 -->
              <span class="vid_0vii052zlz">
                {{ renderStringInTemplate(vid_0vii052zlz_props.rt_text) }}
              </span>
              <!-- end vid_0vii052zlz 简单文本_fjzyutphp4 -->
            </a-col>
            <a-col :span="6">
              <!-- begin vid_x5at6dcy0k 环境： -->
              <span class="vid_x5at6dcy0k"> 环境： </span>
              <!-- end vid_x5at6dcy0k 环境： -->
              <!-- begin vid_afm36je9s2 简单文本_x08mn2nyb0 -->
              <span class="vid_afm36je9s2">
                {{ renderStringInTemplate(vid_afm36je9s2_props.rt_text) }}
              </span>
              <!-- end vid_afm36je9s2 简单文本_x08mn2nyb0 -->
            </a-col>
            <a-col :span="6">
              <!-- begin vid_7cvscjzijx 创建人： -->
              <span class="vid_7cvscjzijx"> 创建人： </span>
              <!-- end vid_7cvscjzijx 创建人： -->
              <!-- begin vid_wf7vfb3eu4 简单文本_9ql39crwjf -->
              <span class="vid_wf7vfb3eu4">
                {{ renderStringInTemplate(vid_wf7vfb3eu4_props.rt_text) }}
              </span>
              <!-- end vid_wf7vfb3eu4 简单文本_9ql39crwjf -->
            </a-col>
          </a-row>
          <!-- end vid_8xrcgsldj2 布局容器_z1jxtyerbz -->
          <!-- begin vid_jqe1zcgcpm 布局容器_5fpubownqv -->
          <a-row class="vid_jqe1zcgcpm" :gutter="16" :slots="'6:6:12'">
            <a-col :span="6">
              <!-- begin vid_0ezxwpl95x 创建时间： -->
              <span class="vid_0ezxwpl95x"> 创建时间： </span>
              <!-- end vid_0ezxwpl95x 创建时间： -->
              <!-- begin vid_268ujyf1tc 简单文本_oreovl9vx4 -->
              <span class="vid_268ujyf1tc">
                {{ renderStringInTemplate(vid_268ujyf1tc_props.rt_text) }}
              </span>
              <!-- end vid_268ujyf1tc 简单文本_oreovl9vx4 -->
            </a-col>
            <a-col :span="6">
              <!-- begin vid_iags95ysyw 计划解决时间： -->
              <span class="vid_iags95ysyw"> 计划解决时间： </span>
              <!-- end vid_iags95ysyw 计划解决时间： -->
              <!-- begin vid_cjg5zxec31 简单文本_9d2ct7jvfo -->
              <span class="vid_cjg5zxec31">
                {{ renderStringInTemplate(vid_cjg5zxec31_props.rt_text) }}
              </span>
              <!-- end vid_cjg5zxec31 简单文本_9d2ct7jvfo -->
            </a-col>
            <a-col :span="12">
              <!-- begin vid_myd08kbt5s 解决人： -->
              <span class="vid_myd08kbt5s"> 解决人： </span>
              <!-- end vid_myd08kbt5s 解决人： -->
              <!-- begin vid_z9dfltlra1 简单文本_qm0rithgwv -->
              <span class="vid_z9dfltlra1">
                {{ renderStringInTemplate(vid_z9dfltlra1_props.rt_text) }}
              </span>
              <!-- end vid_z9dfltlra1 简单文本_qm0rithgwv -->
            </a-col>
          </a-row>
          <!-- end vid_jqe1zcgcpm 布局容器_5fpubownqv -->
        </al-box>
        <!-- end vid_ut0hyv71uf 容器_olru2sccad -->
        <!-- begin vid_m8ou6ez8c2 自定义模板_0poojbef24 -->
        <div class="title" v-if="stateF.showReason">流转或无需解决原因</div>
        <div v-if="stateF.showReason">注意：流转同意后需工单创建人编辑工单,重新派发解决人</div>
        <div class="title" v-else>附件</div>
        <div class="content" v-if="stateF.showReason">
          {{ stateF.reason }}
        </div>
        <div class="content" v-else>
          <div class="file-div" v-for="(item, index) in ppmEnclosureInfoList" @click="handlerDownload(item)">
            <!--                            <a-dropdown>-->
            <!--                                <span-->
            <!--                                    style="-->
            <!--                                        overflow: hidden;-->
            <!--                                        white-space: nowrap;-->
            <!--                                        text-overflow: ellipsis;-->
            <!--                                        display: block;-->
            <!--                                    "-->
            <!--                                    :title="item.name"-->
            <!--                                >-->
            <!--                                    {{ item.name }}-->
            <!--                                </span>-->
            <!--                                <template #overlay>-->
            <!--                                    <a-menu>-->
            <!--                                        <a-menu-item>-->
            <!--                                            <a-button-->
            <!--                                                style="width: 100%"-->
            <!--                                                type="link"-->
            <!--                                                size="small"-->
            <!--                                                @click="previewAttachment(item)"-->
            <!--                                                >预览</a-button-->
            <!--                                            >-->
            <!--                                        </a-menu-item>-->
            <!--                                        <a-menu-item>-->
            <!--                                            <a-button-->
            <!--                                                style="width: 100%"-->
            <!--                                                type="link"-->
            <!--                                                size="small"-->
            <!--                                                @click="handlerDownload(item)"-->
            <!--                                                >下载</a-button-->
            <!--                                            >-->
            <!--                                        </a-menu-item>-->
            <!--                                    </a-menu>-->
            <!--                                </template>-->
            <!--                            </a-dropdown>-->
            {{ item.name }}
          </div>
        </div>
        <!-- end vid_m8ou6ez8c2 自定义模板_0poojbef24 -->
      </al-box>
      <!-- end vid_uxpvwba9ur 容器_mdhrfxo8ha -->
    </a-spin>
  </div>
</template>
<script setup lang="tsx">
  import {
      h, ref, reactive, toRaw, markRaw, watch, computed,
      onBeforeMount, onMounted, onBeforeUnmount, onUnmounted, onActivated, onDeactivated
    } from "vue";
    import { useRoute, useRouter } from 'vue-router';
    const router = useRouter();
    const route = useRoute();
    import { get, post, put, del, request, requestWithHeaders } from '@/utils/http/Axios';
    import { cloneDeep, localGet, merge, getDifferenceArray, traversalTreeStructure, checkCaseCondition, renderStringInTemplate, handleBreadcrumbJump, throttle, permission, getComponentParamsValue } from '@/utils/index';
    import { isNullOrEmpty, isEmptyArr, isNullOrUnDef, isContained, isArray, isEmpty, isObject } from '@/utils/is';
    import dayjs from 'dayjs';
    import { getPagePcChartsDataSourceConvert } from '@/utils/chart';
    import { message, notification, Modal } from 'ant-design-vue'
    import { propertyFormatByNumber, propertyFormatByPercentage, propertyFormatByDate, parseSubFromDataList } from '@/utils/format';
    import colorTheme from '@/design/custom-theme.json';
    
    import UserTableRecords from '@/model/UserTableRecords';
    import { getAppBaseUrl } from '@/utils/index';
    import { sendToken } from "@/hooks/useIframeToken";
    import { useSystemStore } from "@/store/modules/system";
    const systemStore = useSystemStore();
    



      // 获取传入的流程ID和组件参数
      const props = defineProps({
            'processInstanceId': {
            type: [String,Number,Boolean],
            default: undefined,
        },
      })
      const immediateWatch = (source, callback) => {
        watch(source, callback, {deep: true,immediate: true })
      }



  /* -------------------------- 属性定义 -------------------------- */

      const setTimeOutList = [];
      const pageLoading = reactive({
        loading: false,
        tip: undefined
      });
      const authInfo = localGet('app-user-store');

    const vid_8ce19j1ydg_props = reactive({
          rt_text: undefined,
  })

    const vid_zqjezxqu9b_props = reactive({
          rt_text: undefined,
  })

    const vid_cop9kfadhp_props = reactive({
          rt_text: undefined,
  })

    const vid_qf2v3d3c2j_props = reactive({
          rt_text: undefined,
  })

    const vid_a8fpctzwsi_props = reactive({
          rt_text: undefined,
  })

    const vid_rmf47obj3i_props = reactive({
          rt_text: undefined,
  })

    const vid_2uqlwipwoj_props = reactive({
          rt_text: undefined,
  })

    const vid_4sxywu7un5_props = reactive({
          rt_text: undefined,
  })

    const vid_0vii052zlz_props = reactive({
          rt_text: undefined,
  })

    const vid_afm36je9s2_props = reactive({
          rt_text: undefined,
  })

    const vid_wf7vfb3eu4_props = reactive({
          rt_text: undefined,
  })

    const vid_268ujyf1tc_props = reactive({
          rt_text: undefined,
  })

    const vid_cjg5zxec31_props = reactive({
          rt_text: undefined,
  })

    const vid_z9dfltlra1_props = reactive({
          rt_text: undefined,
  })



      // 处理校验
      const setSubFormName =(parentInfo, name)=>{
        return [parentInfo.parents, parentInfo.cycleIndex, name];
      }


  /* ========================== 属性定义 ========================== */


  /* -------------------------- 元素数据引用 -------------------------- */


  /* ========================== 元素数据引用 ========================== */


  /* -------------------------- 页面数据 -------------------------- */

    // 页面数据 工单审批流查询
    const dataConnector_conn_f7ytqx2gzt_response = ref();
    const dataConnector_conn_f7ytqx2gzt = async (additionParams = {}) => {
        const exec = async () => {
          // 获取参数
          const params = {

          };

          // 注入附加的参数
          try {
            merge(params, additionParams);
          } catch (error) {
            console.log(error)
          }

          // 判断加载提示

          // 处理URL
          let url = '/solution-ppm/api/v2/built-in-system-ppm/work_order/approve_info/{instanceId}';
          // 替换url中的变量
          url = url.replace('{instanceId}', String(pageParameter_state.processInstanceId))
          // 排除空参数  日期组件重置后的空参数是[null] 或者[undefined]
          Object.keys(params).forEach(key=>{ if(params[key] === null){ delete params[key] }else if( Object.prototype.toString.call(params[key]) === '[object Object]' ){ Object.keys(params[key]).forEach(childKey=>{ if(params[key][childKey] === null || (Array.isArray(params[key][childKey]) && params[key][childKey].length === 1 && isNullOrUnDef(params[key][childKey]?.[0]))){ delete params[key][childKey] }}) } });
          return get(url, params, {
                headers: {}
              }).then(async (resp) => {
            dataConnector_conn_f7ytqx2gzt_response.value = resp;

            return resp;
          }).catch(async (e) => {


            return Promise.reject(e);
          }).finally(async () => {


          })
        }

          return await exec()

    }


  /* ========================== 页面数据 ========================== */



  /* -------------------------- 响应 -------------------------- */

  /* ========================== 响应 ========================== */


  /* -------------------------- 函数 -------------------------- */

  /* ========================== 函数 ========================== */


  /* -------------------------- 页面参数 -------------------------- */

    const pageParameter_state = reactive({
        'processInstanceId': props.processInstanceId ?? route.query.processInstanceId,
    })

  /* ========================== 页面参数 ========================== */


  /* -------------------------- 组件事件处理方法 -------------------------- */

    // ---------------------------- 组件数据同步 ----------------------------
    // 处理 工单-任务-无需解决 的 rt_text 属性关联
  watch(() => dataConnector_conn_f7ytqx2gzt_response?.value?.data?.approveType,
    () => {
      let dataList = dataConnector_conn_f7ytqx2gzt_response?.value?.data?.approveType

      vid_8ce19j1ydg_props.rt_text = dataList;
    },
    {deep: true})
  // 处理 简单文本_n8z2syxfny 的 rt_text 属性关联
  watch(() => dataConnector_conn_f7ytqx2gzt_response?.value?.data?.content,
    () => {
      let dataList = dataConnector_conn_f7ytqx2gzt_response?.value?.data?.content

      vid_zqjezxqu9b_props.rt_text = dataList;
    },
    {deep: true})
  // 处理 简单文本_uqrw31a556 的 rt_text 属性关联
  watch(() => dataConnector_conn_f7ytqx2gzt_response?.value?.data?.parentContent,
    () => {
      let dataList = dataConnector_conn_f7ytqx2gzt_response?.value?.data?.parentContent

      vid_cop9kfadhp_props.rt_text = dataList;
    },
    {deep: true})
  // 处理 简单文本_uvkw7oc23k 的 rt_text 属性关联
  watch(() => dataConnector_conn_f7ytqx2gzt_response?.value?.data?.type,
    () => {
      let dataList = dataConnector_conn_f7ytqx2gzt_response?.value?.data?.type

      vid_qf2v3d3c2j_props.rt_text = dataList;
    },
    {deep: true})
  // 处理 简单文本_9wrymjzfkt 的 rt_text 属性关联
  watch(() => dataConnector_conn_f7ytqx2gzt_response?.value?.data?.priority,
    () => {
      let dataList = dataConnector_conn_f7ytqx2gzt_response?.value?.data?.priority

      vid_a8fpctzwsi_props.rt_text = dataList;
    },
    {deep: true})
  // 处理 简单文本_8n3wwzc2t0 的 rt_text 属性关联
  watch(() => dataConnector_conn_f7ytqx2gzt_response?.value?.data?.questionSource,
    () => {
      let dataList = dataConnector_conn_f7ytqx2gzt_response?.value?.data?.questionSource

      vid_rmf47obj3i_props.rt_text = dataList;
    },
    {deep: true})
  // 处理 简单文本_mox6lq7e9k 的 rt_text 属性关联
  watch(() => dataConnector_conn_f7ytqx2gzt_response?.value?.data?.areaName,
    () => {
      let dataList = dataConnector_conn_f7ytqx2gzt_response?.value?.data?.areaName

      vid_2uqlwipwoj_props.rt_text = dataList;
    },
    {deep: true})
  // 处理 简单文本_1lnwtw6uij 的 rt_text 属性关联
  watch(() => dataConnector_conn_f7ytqx2gzt_response?.value?.data?.projectName,
    () => {
      let dataList = dataConnector_conn_f7ytqx2gzt_response?.value?.data?.projectName

      vid_4sxywu7un5_props.rt_text = dataList;
    },
    {deep: true})
  // 处理 简单文本_fjzyutphp4 的 rt_text 属性关联
  watch(() => dataConnector_conn_f7ytqx2gzt_response?.value?.data?.production,
    () => {
      let dataList = dataConnector_conn_f7ytqx2gzt_response?.value?.data?.production

      vid_0vii052zlz_props.rt_text = dataList;
    },
    {deep: true})
  // 处理 简单文本_x08mn2nyb0 的 rt_text 属性关联
  watch(() => dataConnector_conn_f7ytqx2gzt_response?.value?.data?.environment,
    () => {
      let dataList = dataConnector_conn_f7ytqx2gzt_response?.value?.data?.environment

      vid_afm36je9s2_props.rt_text = dataList;
    },
    {deep: true})
  // 处理 简单文本_9ql39crwjf 的 rt_text 属性关联
  watch(() => dataConnector_conn_f7ytqx2gzt_response?.value?.data?.createdBy,
    () => {
      let dataList = dataConnector_conn_f7ytqx2gzt_response?.value?.data?.createdBy

      vid_wf7vfb3eu4_props.rt_text = dataList;
    },
    {deep: true})
  // 处理 简单文本_oreovl9vx4 的 rt_text 属性关联
  watch(() => dataConnector_conn_f7ytqx2gzt_response?.value?.data?.createdTime,
    () => {
      let dataList = dataConnector_conn_f7ytqx2gzt_response?.value?.data?.createdTime

      vid_268ujyf1tc_props.rt_text = dataList;
    },
    {deep: true})
  // 处理 简单文本_9d2ct7jvfo 的 rt_text 属性关联
  watch(() => dataConnector_conn_f7ytqx2gzt_response?.value?.data?.endTime,
    () => {
      let dataList = dataConnector_conn_f7ytqx2gzt_response?.value?.data?.endTime

      vid_cjg5zxec31_props.rt_text = dataList;
    },
    {deep: true})
  // 处理 简单文本_qm0rithgwv 的 rt_text 属性关联
  watch(() => dataConnector_conn_f7ytqx2gzt_response?.value?.data?.solver,
    () => {
      let dataList = dataConnector_conn_f7ytqx2gzt_response?.value?.data?.solver

      vid_z9dfltlra1_props.rt_text = dataList;
    },
    {deep: true})
    // ============================ 组件数据同步 ============================


  /* ========================== 组件事件处理方法 ========================== */


  /* -------------------------- 生命周期 -------------------------- */
  // 用于参数变更后重新执行自定义指令
      const queryUpdateFlag = ref(0);
      onMounted(() => { ;dataConnector_conn_f7ytqx2gzt()

    });

    onUnmounted(() => {
      // 销毁定时器
      setTimeOutList.forEach(({ repeat, timer }) => {
        repeat ?  clearInterval(timer): clearTimeout(timer);
      });
    });

  /* ========================== 生命周期 ========================== */


  /* -------------------------- 数据关联处理 -------------------------- */





  /* -------------------------- 表单数据同步 -------------------------- */
  /* ========================== 表单数据同步 ========================== */

  /* ========================== 数据关联处理 ========================== */


  /* -------------------------- 不同组件自定义的处理逻辑 -------------------------- */

  /* ========================== 不同组件自定义的处理逻辑 ========================== */


  // ================================定制化逻辑========================================
  // 附件下载
      const ppmEnclosureInfoList = ref([])
      const taskId = ref(undefined)
      watch(
          () => dataConnector_conn_f7ytqx2gzt_response?.value,
          () => {
              if (dataConnector_conn_f7ytqx2gzt_response?.value?.data.approveType.includes('已解决')) {
                  stateF.showReason = false
                  ppmEnclosureInfoList.value = dataConnector_conn_f7ytqx2gzt_response?.value?.data.attachmentList
              } else {
                  stateF.showReason = true
                  stateF.reason = dataConnector_conn_f7ytqx2gzt_response?.value?.data.reason
              }
          },
          { deep: true }
      )
      console.log('14.20')
      pageLoading.tip = '正在下载请稍后...'
      // 图片预览

      const stateF = reactive({
          previewVisible: false,
          previewImage: '',
          previewFileUrl: '',
          isImagePreview: false,
          showReason: false,
          reson: ''
      })

      function previewAttachment(item) {
          // 检查附件类型
          if (item.type.startsWith('image')) {
              stateF.isImagePreview = true
              stateF.previewImage = item.url // 设置预览图片的URL
              stateF.previewVisible = true // 显示模态框
          } else {
              // stateF.isImagePreview = false;
              // // 如果是其他类型的文件，直接在模态框中显示
              // stateF.previewFileUrl = item.url; // 设置预览文件的URL
              message.info('目前仅支持图片预览')
          }
      }

      function handlerDownload({ url, name }) {
          pageLoading.loading = true

          function downBlob(blob) {
              const downloadElement = document.createElement('a')
              const href = window.URL.createObjectURL(blob) // 创建下载的链接
              downloadElement.href = href
              downloadElement.download = name // 下载后文件名
              document.body.appendChild(downloadElement)
              downloadElement.click() // 点击下载
              document.body.removeChild(downloadElement) // 下载完成移除元素
              window.URL.revokeObjectURL(href)
          }

          const data = new FormData()
          data.append('path', url)
          post('/solution-ppm/api/v2/built-in-system-ppm/delivery_task/downloadFile', data, {
              responseType: 'blob',
              headers: {
                  'Content-Type': 'application/x-www-form-urlencoded'
              }
          })
              .then(blob => {
                  downBlob(blob)
              })
              .finally(() => {
                  pageLoading.loading = false
              })
      }

      function downloadZip(response, name) {
          const blob = new Blob([response], { type: 'application/zip;charset=utf-8' })
          const downloadElement = document.createElement('a')
          const href = window.URL.createObjectURL(blob)
          downloadElement.href = href
          downloadElement.download = name // 下载后文件名
          document.body.appendChild(downloadElement)
          downloadElement.click()
          document.body.removeChild(downloadElement)
          window.URL.revokeObjectURL(href)
          return href
      }
</script>
<style lang="less" scoped>
  .page_root {
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color:#FFFFFF;
  }
  .page_root :deep(.@{ant-prefix}-spin-nested-loading),
  .page_root :deep(.@{ant-prefix}-spin-container)
   {
      height: 100%;
  }
  .page_root :deep(.@{ant-prefix}-spin-container .@{ant-prefix}-table-wrapper)
   {
      display: flex;
      flex-flow: column nowrap;
      justify-content: flex-start;
  }
  .page_root :deep(.@{ant-prefix}-table)
   {
    flex: auto;
    overflow: auto;
  }
  .table-moreBtn_down {
    overflow: hidden; white-space: nowrap; text-overflow: ellipsis; width: 100px;
  }

  .table-moreBtn_menu :deep(.table-moreBtn_menu-item):hover {
    background: #ebf1ff;
  }

  /*  表格树结构样式处理，展开按钮层级增加*/
  :deep(.@{ant-prefix}-table-row-expand-icon) {
    z-index: 1;
  }
  /*  表格树结构 由于每个表格项采用自定义组件，使用绝对定位布局，开启树结构导致显示异常，暂时使用层级定位位置 */
  :deep(.@{ant-prefix}-table-row-level-1 .@{ant-prefix}-table-cell-with-append .cell-wrapper-left) {
    left: 15px !important;
    width: calc(100% - 15px);
  }
  :deep(.@{ant-prefix}-table-row-level-2 .@{ant-prefix}-table-cell-with-append .cell-wrapper-left) {
    left: 30px !important;
    width: calc(100% - 30px);
  }
  :deep(.@{ant-prefix}-table-row-level-3 .@{ant-prefix}-table-cell-with-append .cell-wrapper-left) {
    left: 45px !important;
    width: calc(100% - 45px);
  }
  :deep(.@{ant-prefix}-table-row-level-4 .@{ant-prefix}-table-cell-with-append .cell-wrapper-left) {
    left: 60px !important;
    width: calc(100% - 60px);
  }

  /* 穿梭框改变默认样式，为根据组件样式控制左右栏宽度。 */
  :deep(.@{ant-prefix}-transfer-list)
   {
      height: 100%;
      width: 50%;
  }
  .vid_uxpvwba9ur{
      height:750px;
      overflow-x:hidden;
      overflow-y:auto;
      display:block;
      background-color:#FFFFFF
  }
  .vid_ut0hyv71uf{
      display:block;
      margin-bottom:24px;
      box-shadow:0px 0px 0px 0px
  }
  .vid_qda7xszz78{
      margin-bottom:16px;
      background-color:#FFFFFF
  }
  .vid_sfilmvv65x{
      height:16px;
      display:flex;
      align-items:center;
      flex-wrap:undefined;
      padding-left:8px;
      font-weight:600;
      font-size:16px;
      border-left-style:solid;
      border-left-width:4px;
      border-left-color:#3875FF
  }
  .vid_bhevxdfy3x{
      display:flex;
      flex-direction:row;
      align-items:center;
      flex-wrap:undefined;
      margin-bottom:8px
  }
  .vid_hte17hl8ou{
      min-width:70px;
      font-family:arial, helvetica, "microsoft yahei";;
      font-weight:400;
      color:rgba(89, 89, 89, 1)
  }
  .vid_8ce19j1ydg{
      font-weight:600;
      color:rgba(38, 38, 38, 1)
  }
  .vid_i2ofvy9ut6{
      display:flex;
      flex-direction:row;
      align-items:flex-start;
      flex-wrap:undefined;
      margin-bottom:8px;
      box-shadow:0px 0px 0px 0px
  }
  .vid_xsoiwpee0x{
      min-width:70px;
      font-family:arial, helvetica, "microsoft yahei";;
      font-weight:400;
      color:rgba(89, 89, 89, 1)
  }
  .vid_zqjezxqu9b{
      font-weight:600;
      color:rgba(38, 38, 38, 1)
  }
  .vid_u2aqso72mj{
      min-width:70px;
      font-family:arial, helvetica, "microsoft yahei";;
      font-weight:400;
      color:rgba(89, 89, 89, 1)
  }
  .vid_cop9kfadhp{
      font-weight:600;
      color:rgba(38, 38, 38, 1)
  }
  .vid_nagpuukn82{
      display:flex;
      flex-direction:row;
      align-items:flex-start;
      flex-wrap:undefined;
      margin-bottom:8px;
      box-shadow:0px 0px 0px 0px
  }
  .vid_hj3xdjhqd6{
      font-family:arial, helvetica, "microsoft yahei";;
      font-weight:400;
      color:rgba(89, 89, 89, 1)
  }
  .vid_qf2v3d3c2j{
      font-weight:600;
      color:rgba(38, 38, 38, 1)
  }
  .vid_jah01n1yhb{
      font-family:arial, helvetica, "microsoft yahei";;
      font-weight:400;
      color:rgba(89, 89, 89, 1)
  }
  .vid_a8fpctzwsi{
      font-weight:600;
      color:rgba(38, 38, 38, 1)
  }
  .vid_6fzon2o21y{
      font-family:arial, helvetica, "microsoft yahei";;
      font-weight:400;
      color:rgba(89, 89, 89, 1)
  }
  .vid_rmf47obj3i{
      font-weight:600;
      color:rgba(38, 38, 38, 1)
  }
  .vid_6hbeo2wstw{
      font-family:arial, helvetica, "microsoft yahei";;
      font-weight:400;
      color:rgba(89, 89, 89, 1)
  }
  .vid_2uqlwipwoj{
      font-weight:600;
      color:rgba(38, 38, 38, 1)
  }
  .vid_8xrcgsldj2{
      display:flex;
      flex-direction:row;
      align-items:flex-start;
      flex-wrap:undefined;
      margin-bottom:8px;
      box-shadow:0px 0px 0px 0px
  }
  .vid_q4lwx5giy5{
      font-family:arial, helvetica, "microsoft yahei";;
      font-weight:400;
      color:rgba(89, 89, 89, 1)
  }
  .vid_4sxywu7un5{
      font-weight:600;
      color:rgba(38, 38, 38, 1)
  }
  .vid_14bdavhk13{
      font-family:arial, helvetica, "microsoft yahei";;
      font-weight:400;
      color:rgba(89, 89, 89, 1)
  }
  .vid_0vii052zlz{
      font-weight:600;
      color:rgba(38, 38, 38, 1)
  }
  .vid_x5at6dcy0k{
      font-family:arial, helvetica, "microsoft yahei";;
      font-weight:400;
      color:rgba(89, 89, 89, 1)
  }
  .vid_afm36je9s2{
      font-weight:600;
      color:rgba(38, 38, 38, 1)
  }
  .vid_7cvscjzijx{
      font-family:arial, helvetica, "microsoft yahei";;
      font-weight:400;
      color:rgba(89, 89, 89, 1)
  }
  .vid_wf7vfb3eu4{
      font-weight:600;
      color:rgba(38, 38, 38, 1)
  }
  .vid_jqe1zcgcpm{
      display:flex;
      flex-direction:row;
      align-items:flex-start;
      flex-wrap:undefined;
      box-shadow:0px 0px 0px 0px
  }
  .vid_0ezxwpl95x{
      font-family:arial, helvetica, "microsoft yahei";;
      font-weight:400;
      color:rgba(89, 89, 89, 1)
  }
  .vid_268ujyf1tc{
      font-weight:600;
      color:rgba(38, 38, 38, 1)
  }
  .vid_iags95ysyw{
      font-family:arial, helvetica, "microsoft yahei";;
      font-weight:400;
      color:rgba(89, 89, 89, 1)
  }
  .vid_cjg5zxec31{
      font-weight:600;
      color:rgba(38, 38, 38, 1)
  }
  .vid_myd08kbt5s{
      font-family:arial, helvetica, "microsoft yahei";;
      font-weight:400;
      color:rgba(89, 89, 89, 1)
  }
  .vid_z9dfltlra1{
      font-weight:600;
      color:rgba(38, 38, 38, 1)
  }

  :deep(.@{ant-prefix}-table-empty .@{ant-prefix}-table-tbody tr > td) {
          padding: 0;
      }

      /deep/ .ant3-checkbox-group-item + .ant3-checkbox-group-item span {
          color: #595959 !important;
      }

      /deep/ .ant3-checkbox-wrapper.ant3-checkbox-wrapper-disabled span {
          color: #595959 !important;
      }

      .file-item {
          display: flex;
          width: 100%;
      }

      .file-name {
          width: 75%;
          text-overflow: ellipsis;
          white-space: nowrap;
          overflow: hidden;
      }

      .file-time,
      .file-preview,
      .file-download {
          width: 10%;
          text-align: center;
          cursor: pointer;
      }

      .file-preview,
      .file-download {
          color: #3875ff;
      }

      .vid_qa53gc55by {
          height: 197px;
          box-shadow: 0px 0px 0px 0px;
          display: flex;
          flex-direction: column;
      }

      .file-main {
          width: 35%;
          overflow-y: scroll;
      }

      .title {
          margin-top: 24px;
          height: 16px;
          padding-left: 8px;
          border-left: 4px solid #3875ff;
          line-height: 16px;
              font-weight: 600;
      }

      .content {
          margin-top: 16px;
          height: 200px;
          width: 100%;
        border: 1px solid #d9d9d9;
        padding: 16px;
      }

      .file-div {
          cursor: pointer;
          color: #3875ff;
      }
</style>